package cn.itcast.jx.domain;

import java.util.HashSet;
import java.util.Set;

import org.apache.struts2.json.annotations.JSON;

import com.alibaba.fastjson.annotation.JSONField;


public class User extends BaseEntity{
	
	private String id;
	private String userName;
	private String password;
	private Integer state;
	//用户详细信息
	@JSONField(serialize=false)
	private UserInfo userInfo;
	//用户所属部门
	@JSONField(serialize=false)
	private Dept dept;
	private String email;
	public String getEmail() {
		return email;
	}

	public void setEmail(String email) {
		this.email = email;
	}
	@JSONField(serialize=false)
	private Set<Role> roles = new HashSet<Role>();
	
	@JSON(serialize=false)
	public Set<Role> getRoles() {
		return roles;
	}

	public void setRoles(Set<Role> roles) {
		this.roles = roles;
	}

	public String getId() {
		return id;
	}

	public void setId(String id) {
		this.id = id;
	}

	public String getUserName() {
		return userName;
	}

	public void setUserName(String userName) {
		this.userName = userName;
	}

	public String getPassword() {
		return password;
	}

	public void setPassword(String password) {
		this.password = password;
	}

	public Integer getState() {
		return state;
	}

	public void setState(Integer state) {
		this.state = state;
	}
	@JSON(serialize=false)
	public UserInfo getUserInfo() {
		return userInfo;
	}

	public void setUserInfo(UserInfo userInfo) {
		this.userInfo = userInfo;
	}
	@JSON(serialize=false)
	public Dept getDept() {
		return dept;
	}

	public void setDept(Dept dept) {
		this.dept = dept;
	}
	
	public User() {};
	
	public User(String userName,String password) {
		this.userName = userName;
		this.password = password;
	}
}
